﻿using System.Windows;
using Peter.Sdw.Logic;

namespace Peter.Sdw.View
{
   /// <summary>
   /// Interaction logic for HeaderEditView.xaml
   /// </summary>
   public partial class HeaderEditView
   {
      private HeaderModel m_Header;

      /// <summary>
      /// Initializes a new header edit view.
      /// </summary>
      public HeaderEditView ()
      {
         InitializeComponent ();
         this.DataContextChanged += this.OnDataContextChanged;
      }

      /// <summary>
      /// Occurs when the data context changes.
      /// </summary>
      /// <param name="sender">This.</param>
      /// <param name="e">DependencyPropertyChangedEventArgs</param>
      private void OnDataContextChanged (object sender, DependencyPropertyChangedEventArgs e)
      {
         this.DataContextChanged -= this.OnDataContextChanged;
         this.m_Header = this.DataContext as HeaderModel;
      }
   }
}
